package com.example.hubu20250620.controller;

import com.example.hubu20250620.entity.User;
import com.example.hubu20250620.service.UserService;
import com.example.hubu20250620.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;


@RestController
public class UserController {
    @Autowired
    private UserService userService;
    @GetMapping("/login")
    public Result login(User user){
        return Result.success(userService.getUserByUserName(user));
    }
    @PostMapping("/registry")
    public Result register(@RequestBody User user){
        return Result.success(userService.registry(user));
    }


}
